package com.ruoyi.supervise.complaint.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.supervise.complaint.ro.GetSuperviseOrderEvaluateParam;
import com.ruoyi.supervise.complaint.ro.HandleSuperviseOrderEvaluateParam;
import com.ruoyi.supervise.complaint.service.SuperviseOrderEvaluateService;
import com.ruoyi.supervise.complaint.vo.GetSuperviseOrderEvaluateVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;

/**
 * @description:
 * @author: xly
 * @date: 2022-01-06
 */
@RestController
@RequestMapping("/supervise")
@Api(tags = "监管端---投诉处理")
public class SuperviseOrderEvaluateController extends BaseController {

    @Autowired
    private SuperviseOrderEvaluateService superviseOrderEvaluateService;

    @GetMapping("/get-orderevaluate")
    @ApiOperation("投诉列表")
    public TableDataInfo getOrderevaluate(@Valid GetSuperviseOrderEvaluateParam param)
    {
        startPage();
        List<GetSuperviseOrderEvaluateVo> list = superviseOrderEvaluateService.getOrderevaluate(param);
        return getDataTable(list);
    }

    @PostMapping("/handle-orderevaluate")
    @ApiOperation("监管处理投诉")
    public AjaxResult handleOrderevaluate(@RequestBody @Valid HandleSuperviseOrderEvaluateParam param)
    {
        return toAjax(superviseOrderEvaluateService.handleOrderevaluate(param));
    }

}
